package com.tonicgb.shared.core.crud.dao;

import com.tonicgb.shared.core.crud.mybatis.mapper.provider.SelectSqlProvider;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @author zhaiyujin
 * @date 2021-09-01 21:14:28
 * @说明 定义基础查询
 */
public interface QueryDao<T> extends BaseDao<T> {

    @SelectProvider(
            type = SelectSqlProvider.class,
            method = "get"
    )
    T get(T entity);

    @SelectProvider(
            type = SelectSqlProvider.class,
            method = "findList"
    )
    List<T> findList(T entity);

    @SelectProvider(
            type = SelectSqlProvider.class,
            method = "getByEntity"
    )
    T getByEntity(T entity);


    @SelectProvider(
            type = SelectSqlProvider.class,
            method = "findCount"
    )
    long findCount(T entity);
}
